﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using ServiceAgent.UserAccountService;

namespace Infrastructure.Account
{
    public class ActiveAccount
    {
        private static volatile ActiveAccount instance;
        private static object syncRoot = new Object();

        private ActiveAccount()
        {
            this.TenTaiKhoan = "No Name";
        }

        public static ActiveAccount Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                            instance = new ActiveAccount();
                    }
                }

                return instance;
            }
        }

        public int? ID { get; set; }
        public int? DienThoai { get; set; }
        public string Email { get; set; }
        public Boolean? GioiTinh { get; set; }
        public byte? HinhAnh { get; set; }
        public string MatKhau { get; set; }
        public DateTime? NgaySinh { get; set; }
        public string TenNguoiDung { get; set; }
        public string TenTaiKhoan { get; set; }
        public ObservableCollection<QuyenDTO> DanhSachQuyen { get; set; }
        public ObservableCollection<DonViDTO> DanhSachDonVi { get; set; }
        //Danh sach quyen 

        public void Clear()
        {
            this.ID = null;
            this.DienThoai = null;
            this.Email = null;
            this.GioiTinh = null;
            this.HinhAnh = null;
            this.MatKhau = null;
            this.NgaySinh = null;
            this.TenNguoiDung = null;
            this.TenTaiKhoan = null;
        }
    }
}
